<script setup>
import {ref} from 'vue'
// defineProps(['title','num'])
defineProps({
  title: {type: String, required: true},
  size: {},
  num: {
    type: Number,
    default: 55
  }
})

const size = ref(1)

defineEmits(['bigtxt','msg'])
</script>

<template>
  <div class="sub">
    <button @click="size++">放大文字</button>
    <h1 :style="{fontSize:size+'em'}">Bb.vue</h1>
    <h2 :style="{fontSize:size+'em'}">父组件的title={{ title }},num={{ num }}</h2>
    <button @click="$emit('msg','欢迎','孩子子组件信息')">向父组件传值</button>
  </div>
</template>

<style scoped>
.sub{
  width: 600px;
  height: 200px;
  padding: 6px;
  margin: 5px;
  border:1px solid gray;
}
</style>
